package com.sysfrog.cucumber.psi.psiElements;

import com.intellij.lang.ASTNode;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.psi.PsiReferenceBase;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;

public class DefaultType extends CucumberElement  {
    private DefaultBase reference;

    public DefaultType(@NotNull final ASTNode node) {
        super(node);
        reference = new DefaultBase(this);
    }

    public PsiReference getReference() {
        return reference;
    }

    private class DefaultBase extends PsiReferenceBase<DefaultType> {
        public DefaultBase(DefaultType element) {
            super(element);
        }

        public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
            return super.handleElementRename(newElementName);
        }

        public PsiElement resolve() {
            return null;
        }

        public TextRange getRangeInElement() {
            return new TextRange(0, myElement.getTextLength());
        }

        public Object[] getVariants( ) {
            return new String[]{"Given", "Then", "When", "And"};
        }
    }
}
